<?php

//Load Master Page
require_once('../shared/layout.php');

class Detail extends Layout {

    protected $intProjectId;
    protected $objProject;
    protected $objProjectGalleryArray;
    protected $objProjectServiceArray;

    protected function Form_Create() {
        parent::Form_Create();

        $this->objDefaultWaitIcon->AddCssFile('../../../content/plugins/jquery-prettyPhoto/css/prettyPhoto.css');
        $this->objDefaultWaitIcon->AddCssFile('../../../content/css/project/detail.css');
        
        $this->objDefaultWaitIcon->AddJavascriptFile('../../../content/plugins/jquery-prettyPhoto/js/jquery.prettyPhoto.js');
        $this->objDefaultWaitIcon->AddJavascriptFile('../../../content/js/project/detail.js');
        
        $this->intProjectId =
                QApplication::QueryString('intId');

        if ($this->intProjectId == null)
            QApplication::Redirect('../home');

        $this->objProject =
                Project::Load($this->intProjectId);

        $this->strTitle = $this->objProject->Name;

        $this->objProjectGalleryArray =
                $this->objProject->GetProjectGalleryArray(QQ::Clause(QQ::OrderBy(QQN::ProjectGallery()->Id)));

        $this->objProjectServiceArray =
                $this->objProject->GetProjectServiceArray(QQ::Clause(QQ::OrderBy(QQN::ProjectService()->Service->Order)));
    }

}

Detail::Run('Detail', __DOCROOT__ . __SUBDIRECTORY__ . '/view/project/detail.tpl.php');
?>